package com.insist.dao.Impl;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

/**
 * Created by Administrator on 2016/6/28.
 */
public class TestDaoImpl {

    @PersistenceContext
    private EntityManager em;

    public String testFind(Long id){
        Query q = em.createNativeQuery("SELECT NAME FROM test where id = ?");
        q.setParameter(1, id);
        String s = (String)q.getSingleResult();
        return s;
    }


}
